'use strict';

import ActionTypes from '../constants/ActionTypes';
import Api from './Api';
import Dispatcher from '../core/Dispatcher';

export default {

  loadStories(page) {
    if(!page){
      page = 1;
    }
    var perPage = 12;
    Dispatcher.dispatch({
      action: ActionTypes.LOAD_STORIES
    });
    Api.post(ActionTypes.RECEIVE_STORIES, '/getIndex?p=' + page + '&per_page=' + perPage);
  }

};
